Databases are used to store vast and increasing quantities of data. Languages exist which enable users to query such databases, so as to identify and retrieve desired data, and to otherwise manage and utilize the databases. For example, the structured query language (SQL) is a well-known language which is often used by database administrators and other users to interact with databases.
Even with the existence of such query languages, database interactions may be lengthy, time-consuming, and prone to error. For example, a user may experience a long wait when attempting to access or retrieve data from a database.
An index and associated techniques are intended to facilitate user interactions with databases, and, in particular, are designed to reduce a wait time experienced by a user in retrieving desired data from a database. For example, in relational databases in which information is stored using a series of rows and a corresponding series of columns, the index may store specified, indexed columns and associated values, to thereby provide a query with a specified row when presented with a specific indexed column value. In these and related scenarios, the index keys are thus the set of columns specified during a creation or modification of an index.
Thus, an index represents a distinct data object or data structure which is stored using a same or different database, and which thus consumes computing resources (e.g., memory resources) in exchange for providing its function of facilitating database access and management. Similarly, other costs may be associated with the creation and use of such an index, such as, for example, slower write times experienced by the database, since writes to the database require corresponding updates to the index.
Thus, indexes generally provide certain benefits, at the expense of certain associated costs, so that the creation, management, and use of an index with respect to a particular query and/or database may or may not provide a net benefit to a user. Moreover, since multiple indexes may be created and used with respect to a single database and/or associated queries, it may occur that such indexes (or combinations thereof) provide varying levels of benefit, if any, with respect to one another.
For example, users may often wish to create and submit a plurality of queries together, such as, for example, when one query uses results of another query, or when results of two or more queries are combined to be used as an input for a third query. In these and many other scenarios, creation and/or selection of one or more indexes may be difficult or impossible, since the various queries may experience very divergent levels of benefit, if any, from the use of specific indexes, or combinations thereof.
Moreover, even if an acceptable or optimal creation/selection of one or more indexes is achieved, it may occur that the user may wish to update or modify the associated queries and/or databases. In such cases, previous analysis performed with respect to index creation/selection may no longer be applicable. Thus, it is problematic to create, select, and/or maintain acceptable, desirable, or optimal indexes for accessing and/or managing databases, which minimize wait time and other execution costs, while providing a user with an ability to easily design and implement database queries in a manner which returns fast and accurate query results.